package com.example.wangda.smarthome_pad_host;

/**
 * Created by WangDa on 2017/4/9.
 */

public class extern_define {
    public static final char PROTOCOL_START = 0xAA; //协议起始位
    public static final char PROTOCOL_DEVICES_TYPE = 0x0A; //设备类型

    public static final char PROTOCOL_BOX_ADDR = 0xFF; //网关地址

    public static final char PROTOCOL_DEVICEBROAD_ADDR = 0x00; //设备广播接收
    public static final char PROTOCOL_LOCAT_DOOR = 0xA0; //位置-门口
    public static final char PROTOCOL_LOCAT_STAIRS = 0xA1; //位置-楼梯
    public static final char PROTOCOL_LOCAT_KITCHEN = 0xA2; //位置-厨房
    public static final char PROTOCOL_LOCAT_BATH = 0xA3;   //位置-浴室
    public static final char PROTOCOL_LOCAT_TWOOUT = 0xA4; //位置-二楼外侧
    public static final char PROTOCOL_LOCAL_TWOSLEEP = 0xA6;   //位置-二楼卧室

    //传感器编号
    public static final char PROTOCOL_DOOR_MANSENSER_NUM = 0x01; //门口人体传感器
    public static final char PROTOCOL_STAIRS_MANSENSER_NUM = 0x01; //楼道人体感应
    public static final char PROTOCOL_OUTTWO_MANSENSER_NUM = 0x01; //二楼一外面人体感应
    public static final char PROTOCOL_TWOBEDROOM_MANSENSER_NUM = 0x01; //二楼卧室人体感应

    public static final char PROTOCOL_STAIRS_MOSCHANNEL1_LIGHT = 0x12; //楼道MOS通道1 灯光通道
    public static final char PROTOCOL_OUTTWO_MOSCHANNEL1_LIGHT = 0x12; //二楼外侧MOS通道1 灯光通道
    public static final char PROTOCOL_TWOBED_MOSCHANNEL1_LIGHT = 0x12; //二楼卧室MOS通道1 灯光通道
    public static final char PROTOCOL_STAIRS_MOSCHANNEL2_LIGHT = 0x11; //楼道MOS通道2 灯光通道
    public static final char PROTOCOL_OUTTWO_MOSCHANNEL2_LIGHT = 0x11; //二楼外侧MOS通道2 灯光通道
    public static final char PROTOCOL_TWOBED_MOSCHANNEL2_LIGHT = 0x11; //二楼卧室MOS通道2 灯光通道


    public static final char PROTOCOL_NAME_START = 0;  //引导
    public static final char PROTOCOL_NAME_DESTADDR = 1;   //目的地址
    public static final char PROTOCOL_NAME_DESTCHANNEL = 2;    //目的通道
    public static final char PROTOCOL_NAME_SOURADDR = 3;   //原地址
    public static final char PROTOCOL_NAME_SOURCHANNEL = 4;    //源通道
    public static final char PROTOCOL_NAME_DEVICES_TYPE = 5;   //设备类型
    public static final char PROTOCOL_NAME_DATA_LEN = 6;   //数据长度
    public static final char PROTOCOL_NAME_CMD = 7;        //命令
    public static final char PROTOCOL_NAME_CRC8 = 10;  //CRC校验位

    public static final char PROTOCOL_CMD_QUERY = 0xC1;    //查询
    public static final char PROTOCOL_CMD_MOSSET = 0xC2;   //MOS设置
    public static final char PROTOCOL_CMD_BREATHE = 0xC3;  //呼吸包
    public static final char PROTOCOL_CMD_SENSER = 0xC4;   //传感器数据

    public static final char PROTOCOL_LIGHT_OPEN = 0x01;   //灯光打开
    public static final char PROTOCOL_LIGHT_CLOSE = 0x00;   //灯光关闭


    public static final char PROTOCOL_HANDLE_DOOR_MANSENSER = 0x01; //门口人体感应 handle处理标志
    public static final char PROTOCOL_HANDLE_STAIRS_MANSENSER = 0x02; //楼道人体感应 handle处理标志
    public static final char PROTOCOL_HANDLE_OUTTWO_MANSENSER = 0x03;  //二楼外侧人体感应 hangle处理标志
    public static final char PROTOCOL_HANDLE_TWOBEDROOM_MANSENSER = 0x04;  //二楼卧室人体感应 handle处理标志
    public static final char PROTOCOL_MUSIC_YZCW = 0xA0;  //音乐-渔舟唱晚
    public static final char PROTOCOL_MUSIC_GOHOME = 0xA1;  //音乐-回家
    public static final char PROTOCOL_GET_WEATHER = 0xB0;  //获取天气数据

    public static final char DOORDEVICECHECKBOXSET = 0x00; //设备在线情况CHECKBOX置位
    public static final char STAIRSDEVICECHECKBOXSET = 0x01;
    public static final char OUTTWODEVICECHECKBOXSET = 0x02;
    public static final char TWOBEDROOMDEVICECHECKBOXSET = 0x03;

    public static final char DOORDEVICECHECKBOXRESET = 0x10; //设备在线情况CHECKBOX复位
    public static final char STAIRSDEVICECHECKBOXRESET = 0x11;
    public static final char OUTTWODEVICECHECKBOXRESET = 0x12;
    public static final char TWOBEDROOMDEVICECHECKBOXRESET = 0x13;

    public static final char UDPSENDBREATHEPACK = 0x01;    //UDP发送处理标志-呼吸包
    public static final char UDPSENDSTAIRSLIGHTSET = 0x02; //楼道灯光开
    public static final char UDPSENDSTAIRSLIGHTRESET = 0x03;   //楼道灯光关
    public static final char UDPSENDOUTTWOLIGHTSET = 0x04;     //二楼外侧灯光开
    public static final char UDPSENDOUTTWOLIGHTRESET = 0x05;   //二楼外侧灯光关
    public static final char UDPSENDTWOBEDROOMLIGHTSET = 0x06;   //二楼卧室灯光开
    public static final char UDPSENDTWOBEDROOMLIGHTRESET = 0x07;   //二楼卧室灯光关

    public static final char MANULOPEN = 0x01;  //手动模式-打开
    public static final char MANULCLOSE = 0x02; //手动模式-关闭
    public static final char MANULAUTO = 0x00;  //手动模式-自动

    public static final int DOORDELAY = 30; //进门触发延时
    public static final int STAIRSDELAY = 5; //楼道触发延时
    public static final int TWOBEDDELAY = 90; //二楼卧室触发延时
    public static final int TWOOURDELAY = 5; //进门触发延时
    public static final int PACKSENDDELAY = 60; //呼吸包发送延时.
    public static final int DEVICEONLYDELAY = 180; //设备在线时间计时
}